import Vue from 'vue'
import 'amfe-flexible'

import 'highlight.js/styles/default.css'

import App from './App.vue'
import router from './router'
import store from './store'

import { timeAgo } from './utils/date'

import './directive'

import './permission'

import ArticleItem from './components/ArticleItem'
// 注册一个全局的ArticleItem组件

import './vant'

Vue.component(ArticleItem.name, ArticleItem)

// Vue.use(ArticleItem)// 注册插件，需要自己组件对象的install方法（后续会讲）

Vue.prototype.$timeAgo = timeAgo

Vue.config.productionTip = false

// 打包_去掉打印
if (process.env.NODE_ENV !== 'development') { // process是Node环境全部变量, 运行时根据敲击的命令不同, 脚手架会取环境变量给env添加属性和值
  console.log = function () {}
  console.error = function () {}
  console.dir = function () {}
}

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
